aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send/lightning/[payreq]/+page.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-17 00:20:01 -0800
committerAdam Soltys <[email protected]>2024-11-17 00:20:01 -0800
commit71d5d95f1b6f5dcb4a1d66e234a889c30fa02e3f (patch)
tree152e5309f3dc8992cc906a172e28f7357fc36eb7 /src/routes/(app)/send/lightning/[payreq]/+page.svelte
parentdfd9cc38f013239f681a369eaf9396c6e16ceef0 (diff)
downloadcoinos-ui-71d5d95f1b6f5dcb4a1d66e234a889c30fa02e3f.tar.gz
coinos-ui-71d5d95f1b6f5dcb4a1d66e234a889c30fa02e3f.zip
handle blank offers
Diffstat (limited to 'src/routes/(app)/send/lightning/[payreq]/+page.svelte')
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.svelte23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
index d8bd5f8c..58508809 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
@@ -10,13 +10,13 @@
let { data, form } = $props();
- let { payreq } = $page.params;
let {
alias,
+ payreq,
ourfee,
rates,
user: { currency },
- } = $state(data);
+ } = $derived({ ...data, ...form });
let a = $state();
$effect(() => ($rate ||= rates[currency]));
@@ -25,12 +25,8 @@
let loading = $state();
let submit = () => (loading = true);
- let update = () => {
- if (form?.message?.includes("pin")) $pin = undefined;
- loading = false;
- };
- let show;
+ let next = $state();
let toggle = () => (show = !show);
let amount = $derived(form?.amount || data.amount);
let maxfee = $state(Math.max(5, Math.round(amount * 0.005)));
@@ -128,17 +124,14 @@
{/if}
</form>
{:else}
- <form
- method="POST"
- action="?/setAmount"
- class="w-[300px] mx-auto"
- use:enhance
- >
+ <form method="POST" action="?/setAmount" class="space-y-2" use:enhance>
<input type="hidden" value={a} name="amount" />
<input name="rate" value={$rate} type="hidden" />
- <Numpad bind:amount={a} {currency} bind:rate={$rate} />
- <button type="submit" class="btn"> Next </button>
+ <Numpad bind:amount={a} {currency} bind:rate={$rate} submit={next} />
+ <button type="submit" class="btn" bind:this={next}
+ >{$t("payments.next")}</button
+ >
</form>
{/if}
</div>